<link rel="stylesheet" type="text/css" href="./public/css/cart/index.css">
<div id="header_cart">
	<div class="center">
		<a href='./index.php'><img src="./public/images/cart_logo.png"></a>
		<div style="margin-top:20px;float:right;width:388px;height:48px;background:url(./public/images/cart_jd.png)" class="cart_jd"></div>
	</div>
</div>
<!-- --------------------------------------- -->
<div id="cart_container">
	<div class="center">
	<!-- <img src='./public/images/cart_tit.png'> --><br><br><br>
		<table border='1' width='100%' cellspacing='0' bordercolor='#ccc'>
			<tr height='34' bgcolor='#fafafa'>
				<th class='jmfh' colspan='2'>oppo商城发货</th><td class='jstit'>库存</td><td class='jstit'>商品名称</td><td class='jstit'>(元)</td><td class='jstit'>数量</td><td class='jstit'>小计</td><td class='jstit'>操作</td>
			</tr>
			<?php
				$allPri=0;
				$num=0;
				if(!empty($_SESSION['cart'])){
					foreach($_SESSION['cart'] as $good){
					echo "<tr>
							<th><input type='checkbox' name='ids' type='' /></th>
							<th height='100' width='300'><img src='./admin/public/images/goods/sm_$good[gpic]' /></th>
							<th class='cnt'>$good[cnt]</th>
							<th class='gname'>$good[gname]</th>
							<th class='price'>$good[price]</th>
							<th class='connum'><a class='change' href='./index.php?c=cart&a=change&gid=$good[gid]&act=cut'>-</a> $good[num] <a class='change' href='./index.php?c=cart&a=change&gid=$good[gid]&act=add'>+</a></th>
							<th class='xj'>".$good['price']*$good['num']."</th>
							<th><a href='./index.php?c=cart&a=cut&gid=$good[gid]'><img src='./public/images/del.png' /></a></th>
						</tr>";
						$allPri += $good['price']*$good['num'];
						$num += $good['num'];
					}
				}
			?>
			<tr height='34' bgcolor='#fafafa'>
				<td colspan='8' style='text-align:right'><b class='shopPriTit'>商品金额: </b><b class='endPri'>￥<?php echo $allPri;?></b>&nbsp;</td>
			</tr>
		</table>
		<div class="js">
			<ul class='left'>
				<li>&nbsp;</li>
				<li><a href='./index.php'>继续购物</a></li>
				<li>&nbsp;|&nbsp;</li>
				<li><a href='./index.php?c=cart&a=truncate'>清空所有商品</a></li>
			</ul>
			<ul class='right'>
			<?php
				if(empty($_SESSION['cart'])){
					echo "<a><li class='disgojs'>去结算</li></a>";
				}else{
					echo "<a href='./index.php?c=orders&a=info'><li class='gojs'>去结算</li></a>";
				}	
			?>
				<li>&nbsp;&nbsp;&nbsp;</li>
				<li class='alltit'>商品应付总额: <b class='allpri'>￥<?php echo $allPri;?></b></li>
				<li>&nbsp;&nbsp;&nbsp;</li>
				<li class='numtit'>共<b class='num'><?php echo $num;?></b>件商品</li>
			</ul>
		</div>
	</div>
</div>